#include <bits/stdc++.h>
#define N 1000006
using namespace std;
typedef long long ll;

int n;
long double h[N], r[N], R[N], k[N], ans[N];

int main ()
{
    freopen("wan.in", "r", stdin);
    freopen("wan.out", "w", stdout);

    scanf("%d", &n);
    for (int i=1; i<=n; i++) {
        scanf("%Lf %Lf %Lf", &h[i], &r[i], &R[i]);
    }

    long double prt=0;

    // cout<<fixed<<setprecision(12);

    for (int i=1; i<=n; i++) {
        ans[i]=h[i];
        k[i]=(h[i]*2.0/(R[i]-r[i]));

        long double res=0;

        for (int j=1; j<i; j++) {
            if (k[i]<k[j]) {
                if (r[i]<R[j]) {
                    if (R[i]>R[j]) {
                        res=ans[j]+(h[i]*(R[i]-R[j])/(R[i]-r[i]));
                    }
                    else {
                        res=ans[j]-h[j]+max(h[i], (h[j]*(R[i]-r[j])/(R[j]-r[j])));
                    }
                }
                else {
                    res=ans[j]+h[i];
                }
            }
            else {
                if (r[i]<r[j]) {
                    res=ans[j]-h[j]+h[i];
                }
                else if (r[i]<R[j] && r[i]>=r[j]) {
                    res=ans[j]-h[j]+h[i]+(h[j]*(r[i]-r[j])/(R[j]-r[j]));
                }
                else if (r[i]>R[j]) {
                    res=ans[j]+h[i];
                }
            }
            ans[i]=max(ans[i], res);
            // cout<<i<<" "<<j<<" "<<res<<endl;
        }
        prt=max(prt, ans[i]);
        // cout<<ans[i]<<endl;
    }

    printf("%.12Lf\n", prt);

    return 0;
}